# -*- coding: utf -8 -*-
d1 = {'Programacao 1': 11,
     'Programacao 2': 11,
     'Matematica'   : 10,
     'Linguagem de Programacao' : 17}
d1['Algebra'] = 13
print d1['Programacao 2']

media = 0.0
c = 0
for valor in d1.itervalues():
    media += valor
    c+= 1
media /= c

print "media = ", media

for chave, valor in d1. iteritems():
    print chave , valor

def gerar_media(N):
        for valor in range(N):
            yield media
#gen=gerar_media(5)

print
for y in gerar_media(5):
    print y
